import { createStore, combineReducers, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'

// 导入项目的reducer
import { login } from './reducers/login'
import { user } from './reducers/user'
// 接入 redux 插件
import { composeWithDevTools } from 'redux-devtools-extension'

// 整合多个插件
const middleWares = composeWithDevTools(applyMiddleware(thunk))
const rootReducer = combineReducers({ login, user })
// 创建store
export const store = createStore(rootReducer, middleWares)
